package com.infoland.afanmall.model.order.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.LinearLayoutCompat;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.infoland.afanmall.R;
import com.infoland.afanmall.base.util.LogKit;
import com.infoland.afanmall.base.util.ToolsKit;
import com.infoland.afanmall.model.order.entity.OrderInFoResponse;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class OrderInfoAdapter extends BaseQuickAdapter<OrderInFoResponse.OrderItemListBean, BaseViewHolder> {

    @BindView(R.id.order_info_block3_img)
    AppCompatImageView orderInfoBlock3Img;
    @BindView(R.id.order_info_block3_txt_content)
    AppCompatTextView orderInfoBlock3TxtContent;
    @BindView(R.id.order_info_block3_txt_gui_ge)
    AppCompatTextView orderInfoBlock3TxtGuiGe;
    @BindView(R.id.order_info_block3_price)
    AppCompatTextView orderInfoBlock3Price;
    @BindView(R.id.order_info_block3_count)
    AppCompatTextView orderInfoBlock3Count;
    @BindView(R.id.order_info_block3)
    LinearLayoutCompat orderInfoBlock3;

    public OrderInfoAdapter(int layoutResId, @Nullable List<OrderInFoResponse.OrderItemListBean> data) {
        super(R.layout.order_info_include_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderInFoResponse.OrderItemListBean item) {
        ButterKnife.bind(this, helper.itemView);
        LogKit.E(" item  ", "  " + item);
        ToolsKit.setImgView(item.getF_url(), orderInfoBlock3Img);
        orderInfoBlock3TxtContent.setText(item.getGoods_name() + "");
        orderInfoBlock3TxtGuiGe.setText(item.getSpec_val_str() + "");
        orderInfoBlock3Price.setText("￥" + item.getGoods_price() + "");
        orderInfoBlock3Count.setText("x " + item.getGoods_count());
    }

}
